<%@page import="com.rocky.ssm.dao.stuBaseDao"%>
<%@page import="com.rocky.ssm.model.Students"%>
<%@page language="java" import="java.util.*" pageEncoding="utf-8"%>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
<%


	//1 处理编码
	request.setCharacterEncoding("utf-8");
	response.setCharacterEncoding("utf-8");
	
	//2 接收参数(后期考虑是否可以循环遍历传值)
	String stuName = request.getParameter("stu_name");
	String stuGender = request.getParameter("stu_gender");
	String strAge = request.getParameter("stu_age");
	int stuAge = 0;
	if(strAge != null && !"".equals(strAge)) {
		stuAge = Integer.parseInt(strAge.trim());
	}
	String stuTel = request.getParameter("stu_tel");
	String stuEmail = request.getParameter("stu_email");
	String stuIDcard = request.getParameter("stu_IDcard");
	String stuAddress = request.getParameter("stu_address");
	String stuBirth = request.getParameter("stu_birth");
	String stuSchool = request.getParameter("stu_school");
	String stuQq = request.getParameter("stu_QQ");
	String stuParentName = request.getParameter("stu_parent_name");
	String stuProvince = request.getParameter("stu_province");
	String stuParentTel = request.getParameter("stu_parent_tel");
	String stuCity = request.getParameter("stu_city");
	String stuStatus = request.getParameter("stu_status");
	String stuContent = request.getParameter("stu_content");
	
	//和对象建立关联关系
	Students students = new Students(stuName,stuGender,stuAge,stuTel,
	stuEmail,stuIDcard,stuAddress,stuBirth,stuSchool,stuQq,stuParentName,
	stuProvince,stuParentTel,stuCity,stuStatus,stuContent
	);
		
	//3 调用executeUpdate()方法
	stuBaseDao sbd = new stuBaseDao();
	 int  result = sbd.stuAdd(students);

	//4 页面跳转
		request.getRequestDispatcher("stu_pay.jsp").forward(request, response);

%>
